package com.xiaoshuidi.cloud.module.bpm.enums.reserveticket;

import cn.hutool.core.util.ObjectUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum UrgencyLevelEnum {
    URGENT("紧急","1"),
    NORMAL("正常","2"),
    DELAYED("延后","3");

    private String name;
    private String value;

    public static String getNameByValue(String value){
        UrgencyLevelEnum urgencyLevelEnum = Arrays.stream(UrgencyLevelEnum.values()).filter(p -> p.getValue().equals(value)).findFirst().orElse(null);
        if(ObjectUtil.isEmpty(urgencyLevelEnum)){
            return "";
        }
        return urgencyLevelEnum.getName();
    }
}
